<!DOCTYPE html>
<html>
<head>
    <title>fileFromUrlAccess</title>
    <meta charset="utf-8">
</head>
<body>
    <div id="result">fileFromUrlAccess</div>
</body>
<script type="text/javascript">
    function load(name){
        let xhr=new XMLHttpRequest(),
        okStatus=document.location.protocol==="file:" ? 0 : 200;
        console.log("okStatus:"+okStatus);
        xhr.open("GET",name,false);
        xhr.overrideMimeType("text/html;charset=utf-8")
        xhr.send(null);
        return xhr.status===okStatus?xhr.responseText:null;
    }
    let text=load("file:///data/storage/el1/bundle/phone/resources/rawfile/fileFromUrlAccess.html");
    document.getElementById("result").innerHTML=text;
    function getFileResult(){
        let text=document.getElementById("result").innerHTML;
        return text
    }
</script>
</html>